var nowImage = 0;

timer = setInterval(function(){
    $("#images").css("margin-left",nowImage * 600+ "px");
    if(nowImage != 0){
        $("#images").css("transition","all 1s");
    }else{
        $("#images").css("transition","none");
    }
    nowImage ++;
    if(nowImage == 5) {
        nowImage = 0;
    }
},3000);